#include <iostream>
#include <memory>
#include "UdpServer.hpp"
#include "Dict.hpp"

const std::string dict_path = "./dict.txt";

int main() {
    EnableToScreen();
    // 服务器ip一般指定为0，服务器可以收到来自任意ip的信息（只要求端口对应）
    Dict dict(dict_path);
    func_t translate = std::bind(&Dict::Translate, &dict, std::placeholders::_1);
    UdpServer* usvr = new UdpServer(translate, "127.0.0.1", 8899);
    usvr->Init();
    usvr->Start();
    
    return 0;
}